import re
s = "小明年龄18岁 工资10000"
res = re.search(r"\d+",s).group()
print("search结果",res)

res = re.findall(r"\d+",s)
print("findall结果",res)

res = re.match("小明",s).group()
print("match结果",res)

res = re.match(r"\d+",s)
print("试错，不加group为none，匹配不到",res)

res = re.match("工资",s).group()
print("match结果",res)